<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('News/index')}">新闻列表</a></li>
        <li><a href="{:url('News/add')}">添加新闻</a></li>
        <li class="active"><a href="{:url('News/recycle')}">回收站</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('News/recycle')}">
        <input type="text" class="form-control" name="name" style="width: 190px;" value="{:input('request.name','')}" placeholder="请输入专业名称">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('News/recycle')}">清空</a>
    </form>
    <form class="js-ajax-form" method="post">
        <button type="submit" class="btn btn-danger js-ajax-submit" data-action="{:url('News/batchDelete')}">
            <i class="fa fa-trash fa-fw"></i>删除
        </button>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th>排序字段</th>
                <th>id</th>
                <th>标题</th>
                <th>作者</th>
                <th>封面</th>
                <th>浏览量</th>
                <th>摘要</th>
                <th>删除时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="v">
                <tr>
                <tr>
                    <td>
                        <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="">
                    </td>
                    <td>
                        <input name='list_orders[{$v.id}]' class="input input-order mr5" type='text' size='3' value='{$v.list_order}'>
                    </td>
                    <td>{$v.id}</td>
                    <td>{$v.title}</td>
                    <td>{$v.author}</td>
                    <td><img src="/upload/{$v.image}" style="width: 80px;height: 50px"></td>
                    <td>{$v.look_num}</td>
                    <td>{$v.abstract}</td>
                    <td>{$v.delete_time}</td>
                    <td>
                        <a class="btn btn-xs btn-primary" title="恢复数据" data-toggle="tooltip" href="{:url('News/recover')}?id={$v.id}">
                            恢复
                        </a>
                        <a href="{:url('News/delete',array('id'=>$v['id']))}" class="js-ajax-delete btn btn-xs btn-danger" data-msg="确定删除它吗？">
                            <i class="fa fa-trash fa-fw"></i>
                        </a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </form>
    <div>
        <div class="pagination">{$list->render()}</div>
        <div>共有{$list->total()}条，每页显示{$list->listRows()}条，当前第{$list->currentPage()}页，共{$list->lastPage()}页。</div>
    </div>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js?v={$_static_version}"></script>
<script>
    function checkAll(obj){
        //console.log(obj.checked);
        var checkbox = document.getElementsByName('id[]');
        for(let i=0;i<checkbox.length;i++){
            checkbox[i].checked = obj.checked;
        }
    }
</script>
</body>
</html>
